<?php

/**
 * AbetStudent filter form base class.
 *
 * @package    sfproject
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAbetStudentFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'dep_code'     => new sfWidgetFormPropelChoice(array('model' => 'AbetDepartment', 'add_empty' => true)),
      'ins_code'     => new sfWidgetFormPropelChoice(array('model' => 'AbetInstructor', 'add_empty' => true)),
      'password'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'first_name'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'mid_name'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'grand_name'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'last_name'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'start_date'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'level_number' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ssn'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'birth_date'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'sex'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'degree'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'gpa'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'email'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'phone'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'mobile'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'city'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'street'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'pobox'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'updated_at'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'dep_code'     => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetDepartment', 'column' => 'dep_code')),
      'ins_code'     => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetInstructor', 'column' => 'ins_code')),
      'password'     => new sfValidatorPass(array('required' => false)),
      'first_name'   => new sfValidatorPass(array('required' => false)),
      'mid_name'     => new sfValidatorPass(array('required' => false)),
      'grand_name'   => new sfValidatorPass(array('required' => false)),
      'last_name'    => new sfValidatorPass(array('required' => false)),
      'start_date'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'level_number' => new sfValidatorPass(array('required' => false)),
      'ssn'          => new sfValidatorPass(array('required' => false)),
      'birth_date'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'sex'          => new sfValidatorPass(array('required' => false)),
      'degree'       => new sfValidatorPass(array('required' => false)),
      'gpa'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'email'        => new sfValidatorPass(array('required' => false)),
      'phone'        => new sfValidatorPass(array('required' => false)),
      'mobile'       => new sfValidatorPass(array('required' => false)),
      'city'         => new sfValidatorPass(array('required' => false)),
      'street'       => new sfValidatorPass(array('required' => false)),
      'pobox'        => new sfValidatorPass(array('required' => false)),
      'created_at'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('abet_student_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetStudent';
  }

  public function getFields()
  {
    return array(
      'dep_code'     => 'ForeignKey',
      'stu_code'     => 'Number',
      'ins_code'     => 'ForeignKey',
      'password'     => 'Text',
      'first_name'   => 'Text',
      'mid_name'     => 'Text',
      'grand_name'   => 'Text',
      'last_name'    => 'Text',
      'start_date'   => 'Date',
      'level_number' => 'Text',
      'ssn'          => 'Text',
      'birth_date'   => 'Date',
      'sex'          => 'Text',
      'degree'       => 'Text',
      'gpa'          => 'Number',
      'email'        => 'Text',
      'phone'        => 'Text',
      'mobile'       => 'Text',
      'city'         => 'Text',
      'street'       => 'Text',
      'pobox'        => 'Text',
      'created_at'   => 'Date',
      'updated_at'   => 'Date',
    );
  }
}
